<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>Document</title>
	</head>
	<body>
		<script>
			function Star(uname, age) {
				// 一般情况下，公共属性定义在构造函数里面
				this.uname = uname;
				this.age = age;
				// this.sing = function () {
				// 	console.log('vvaaee');
				// };
			}
			// 公共方法放到原型对象身上
			Star.prototype.sing = function () {
				console.log('vvaaee');
			};

			let vae = new Star('vae', 35);
			let uae = new Star('uae', 35);

			console.log(vae.sing === uae.sing);

			console.dir(Star);
		</script>
	</body>
</html>
